package com.littleinc.orm_benchmark.greendao.mydao;

import android.database.sqlite.SQLiteDatabase;

import com.littleinc.orm_benchmark.greendao.MessageDao;
import com.littleinc.orm_benchmark.greendao.UserDao;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

/**
 * reate by tao on{DATE}
 */
public class DaoSession  extends AbstractDaoSession {
    private final DaoConfig teacherDaoConfig;
    private final TeacherDao userDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?,?>>, DaoConfig> daoConfigMap) {
        super(db);
        teacherDaoConfig = daoConfigMap.get(Teacher.class).clone();
        teacherDaoConfig.initIdentityScope(type);
        userDao = new TeacherDao(teacherDaoConfig, this);
    }

    public TeacherDao getUserDao() {
        return userDao;
    }
}
